package com.aaa.ps.controller;

import com.aaa.ps.service.MenuServiceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.aaa.common.entity.Menu;
import java.util.List;

@RestController
@RequestMapping("menu")
public class MenuContorller {

    @Autowired
    private MenuServiceMapper menuServiceMapper;




    @DeleteMapping("deleteByPrimaryKey")
    public int deleteByPrimaryKey(Integer menuId){
        return menuServiceMapper.deleteByPrimaryKey(menuId);
    }

    @PostMapping("insertSelective")
   public int insertSelective(@RequestBody Menu record){
        return  menuServiceMapper.insertSelective(record);
    }
    @GetMapping("selectByPrimaryKey")
    public Menu selectByPrimaryKey(Integer menuId){
        return menuServiceMapper.selectByPrimaryKey(menuId);
    }
    @PutMapping("updateByPrimaryKeySelective")
    public int updateByPrimaryKeySelective(@RequestBody Menu record){
        return menuServiceMapper.updateByPrimaryKeySelective(record);
    }



    @GetMapping("selectAll")
    public List<Menu> selectAll(){
        return menuServiceMapper.selectAll();
    }



}
